package grape.attend.service.user.po;

import grape.common.service.common.IDictItem;
import grape.common.service.common.dictenums.IBaseDictEnum;
import grape.common.service.po.NormalBasePo;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 用户请/补假单表
 * </p>
 *
 * @author yangwei
 * @since 2020-05-29
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("attend_user_leave_application")
public class UserLeaveApplication extends NormalBasePo<UserLeaveApplication> {

    private static final long serialVersionUID = 1L;

    // 流程定义key
    public static final String PROCESS_DEFINITION_KEY = "ATTEND_USER_LEAVE_APPLICATION";

    /**
     * 请假单审批状态字典
     */
    public enum DictApproveStatus implements IDictItem {
        user_leave_application_approve_unsubmit, // 未提交
        user_leave_application_approve_inapprove, // 审批中
        user_leave_application_approve_pass, // 审批通过
        user_leave_application_approve_unpass,
        ; // 未审批通过

        @Override
        public String itemCode() {
            return this.name();
        }}
    /**
     * 用户id
     */
    private String userId;

    /**
     * 流水号，请假单号
     */
    private String serialNo;

    /**
     * 审批状态，字典id
     */
    private String approveStatusDictId;

    /**
     * 是否请假，否则补假
     */
    private Boolean isAskForLeave;

    /**
     * 审批提交时间
     */
    private Long approveSubmitAt;

    /**
     * 审批结束时间
     */
    private Long approveFinishAt;

    /**
     * 原因、理由
     */
    private String reason;

    /**
     * 备注
     */
    private String remark;


    @Override
    protected Serializable pkVal() {
        return null;
    }

}
